﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows.Media;
using UBCon.Core.Commands;
using UBCon.Core.Enums;

namespace UBConDemo.Models
{
    public class OptionsItemModel:INotifyPropertyChanged
    {
        #region Private fields

        private string imageSource;

        private string title;

        private string description;

        private bool shouldRaiseEvent=false;

        private RibbonBarMode mode;
        #endregion

        #region Properies

        /// <summary>
        /// Gets or sets current state of the RibbonBar.
        /// </summary>
        public RibbonBarMode Mode
        {
            get
            {
                return mode;
            }
            set
            {
                shouldRaiseEvent = mode != value;

                mode = value;
                if (shouldRaiseEvent)
                {
                    OnPropertyChanged("Mode");
                }
            }
        }

        /// <summary>
        /// Gets or sets string represantation of image source.
        /// </summary>
        public string ImageSource 
        {
            get 
            {
                return imageSource;
            }
            set 
            {
                shouldRaiseEvent = imageSource != value;
                imageSource = value;
                if (shouldRaiseEvent)
                {
                    OnPropertyChanged("ImageSource");
                }
            } 
        }

        /// <summary>
        /// Gets or sets header text.
        /// </summary>
        public string Title
        {
            get 
            {
                return title;
            }
            set 
            {
                shouldRaiseEvent = title != value;
                title = value;
                if (shouldRaiseEvent)
                {
                    OnPropertyChanged("Title");
                }
            }
        }

        /// <summary>
        /// Gets or sets text of content,
        /// </summary>
        public string Description 
        {
            get 
            {
                return this.description;
            }
            set 
            {
                shouldRaiseEvent = description != value;
                description = value;
                if (shouldRaiseEvent)
                {
                    OnPropertyChanged("Description");
                }
            }
        }

        private void OnPropertyChanged(string propertyName) 
        {
            if (PropertyChanged != null) 
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
        #endregion

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
